package main

import (
	"github.com/graarh/golang-socketio"
	"github.com/graarh/golang-socketio/transport"
)

func getSocket() *gosocketio.Client {
	c, _ := gosocketio.Dial(
		gosocketio.GetUrl("localhost", 5000, false),
		transport.GetDefaultWebsocketTransport(),
	)
	//c.Emit("join", models.JoinMsg{Room:"xx", User:random.RandNumString(6)})
	return c
}

func main() {
	ClientNum := 50000
	cc := make([]*gosocketio.Client, ClientNum)

	for ii := 0; ii < ClientNum; ii++ {
		go func() {
			cc = append(cc, getSocket())
		}()
	}

	select {}

	//close connection
	//c.Close()
}
